<?php
/**
 * Created by PhpStorm.
 * 商品属性
 * User: caicm
 * Date: 2017/6/17
 * Time: 17:19
 */

namespace WMApi\Model;


use Think\Model;

class WmAttrModel extends Model {

    /**
     * 店铺商品属性名
     * Created By caicm
     * @param int $classify_id 运营分类id
     * @param int $attr_type 属性类型（1：主要属性，2：次要属性）
     * @return mixed
     */
    public function get_attr_info($classify_id=0, $attr_type=1){

        $where = array(
            'classify_id' => $classify_id,
            'is_start' => 1,
            'attr_type' => $attr_type,
            'is_del' => 0
        );

        $field = 'attr_id,attr_name ';

        return $this->field($field)->where($where)->order('attr_id desc')->find();

    }
}